home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/perl5
- #
- # rstat.frm
- #
- # Copyright 1988-1996 Silicon Graphics, Inc.
- # All rights reserved.
- #
- # This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- # the contents of this file may not be disclosed to third parties, copied or
- # duplicated in any form, in whole or in part, without the prior written
- # permission of Silicon Graphics, Inc.
- #
- # RESTRICTED RIGHTS LEGEND:
- # Use, duplication or disclosure by the Government is subject to restrictions
- # as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- # and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- # successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- # rights reserved under the Copyright Laws of the United States.
- #
- # $Id: rstat.frm,v 1.3 1998/02/11 23:20:45 jrw Exp $
-
- BEGIN { require "/usr/WebFace/lib/CGI.pm"; import CGI; }
- require "/usr/OnRamp/lib/OnRamp.pm";
-
- $title = "Show RSVP Sessions";
-
- $query = new CGI;
-
- print $query->header;
- &title_block($title);
-
- sub error {
- &error_block($_[0]);
- print $query->end_html;
- system("/sbin/rm", "-f", $dummy);
- exit 0;
- }
-
- &header_block($title);
-
- if (! -e "/usr/etc/rstat")
- {
- print "<i>The RSVP session tool (rstat) is available on "
- . "IRIX versions 6.5 and higher. For information "
- . "about upgrading to IRIX 6.5, please contact your "
- . "local Silicon Graphics sales representative.</i>\n"
- . "</body></html>\n";
- exit 0;
- }
-
- open (RSTAT, "/usr/etc/rstat -p |") || &error("Can't get session status.");
- @sessions = <RSTAT>;
- close(RSTAT);
-
- if ($#sessions == 0) {
- &error("RSVP is not enabled.");
- } elsif ($#sessions == 1) {
- print qq|<p><br><br><font size=4>There are currently no
- sessions to view.</font>|;
- } else {
-
- for ($i = 0; $i <= $#sessions; $i++) {
- $line = $sessions[$i];
- chop($line);
- if ($line =~ /^\s*$/) {
- print $line;
- } elsif ($line =~ /^Iface/) {
- print "<center><table cellpadding=5 width=450 border=2>\n";
- print "<tr><th>Interface<th>Type<th>Session",
- "<th>Sender<th>Neighbor</tr>\n";
- } elsif ($line =~ /^\s+\>\>/) {
- print "<tr><td colspan=5 align=right>$line</tr>\n";
- } elsif ($line =~ /^-- Path --/) {
- ($tmp,$tmp,$tmp,$session,$sender,$neighbor) = split(/\s+/, $line);
- print "<tr align=center><td colspan=2>-- Path --<td>$session",
- "<td>$sender<td>$neighbor</tr>\n";
- } else {
- ($iface,$type,$session,$sender,$neighbor) = split(/\s+/, $line);
- print "<tr align=center><td>$iface<td>$type<td>$session",
- "<td>$sender<td>$neighbor</tr>\n";
- }
- }
- print "</table></center><br>\n";
- }
-
- print $query->end_html;
-
-